<!DOCTYPE html>
<html lang="en" xmlns: xmlns:th="http://www.thymeleaf.org">
<head th:include="common/admin/common::common_head">
    <title>管理员首页</title>
</head>
<body class="cm-no-transition cm-1-navbar">
<div th:include="common/admin/common::common_footer_script"/>
<!--后台公共侧边栏（菜单）-->
<div th:replace="common/admin/common::common_siderbar"></div>
<!--后台公共顶部-->
<div th:replace="common/admin/common::common_top"></div>
<div id="global">
    <div class="container-fluid">

        <div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">审核信息</div>
                    <div class="panel-body">
                        <p style="margin-bottom:0">Audit should be careful <code>and do not be distracted</code></code></p>
                    </div>
                    <table class="table-condensed">
                        <!--
                        table-condensed
                        -->
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>真实姓名</th>
                            <th>借款人年龄</th>
                            <th>借款人电话</th>
                            <th>本身身份证</th>
                            <th>详细地址</th>
                            <th>工作单位</th>
                            <th>工作单位所在地址</th>
                            <th>月收入</th>
                            <th>借款金额</th>
                            <th>借款用途</th>
                            <th>借款时间</th>
                            <!--<th>借款期限</th>-->
                            <th>利息</th>
                            <th>借款状态</th>
                            <th>抵押物</th>
                            <th>审批</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="active" th:each="entry:${loanlist}">
                            <th scope="row" th:text="${entry.lid}"></th>
                            <td th:text="${entry.loanname}"></td>
                            <td th:text="${entry.maxage}"></td>
                            <td th:text="${entry.phone}"></td>
                            <td th:text="${entry.idcard}"></td>
                            <td th:text="${entry.address}"></td>
                            <td th:text="${entry.work}"></td>
                            <td th:text="${entry.workaddress}"></td>
                            <td th:text="${entry.monthmoney}"></td>
                            <td th:text="${entry.money}"></td>
                            <td th:text="${entry.loanuse}"></td>
                            <!--<td  th:text="${entry.loanstartdate}"></td>-->
                            <td th:text="${#dates.format(entry.loanstartdate,'yyyy-MM-dd')}"></td>
                            <td th:text="${entry.loaninterest}"></td>
                            <td th:text="${entry.loantype}"></td>
                            <td th:if="${entry.loantype}!= '万能房抵贷' and ${entry.loantype}!= '汽车抵押贷'">
                                无
                            </td>
                            <td th:if="${entry.loantype}== '万能房抵贷'">
                                <div class="btn-group" role="group">
                                    <a class="btn btn-info get-action" id="showModal"
                                       th:href="@{/loan/back-audit/selmodalapply(id=${entry.lid},applyMType=${entry.loantype})}" type="button">
                                        <i class="fa fa-fw fa-search-plus"></i>
                                    </a>
                                </div>
                            </td>
                            <td th:if="${entry.loantype}== '汽车抵押贷'">
                                <div class="btn-group" role="group">
                                    <a class="btn btn-info get-action" id="showModal"
                                       th:href="@{/loan/back-audit/selmodalapply(id=${entry.lid},applyMType=${entry.loantype})}" type="button">
                                        <i class="fa fa-fw fa-search-plus"></i>
                                    </a>
                                </div>
                            </td>
                            <td>
                                <a class="btn btn-success" onclick="auditSubmit('同意',id)" th:id="tony+${entry.lid}" th:value="${entry.lid}">同意</a>
                                <a class="btn btn-danger" onclick="auditSubmit('拒绝',id)" th:id="toy+${entry.lid}" th:value="${entry.lid}">拒绝</a>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <ul class="pagination" style="margin-left: 500px">
            <li><a th:href="@{/loan/back-audit/list(currPage=1)}">&laquo;</a></li>
            <li><a th:href="@{/loan/back-audit/list(currPage=${pager.currPage-1})}">&lt;</a></li>
            <!--<li th:each="pp:${pager.totalPage}"><a href="#" th:text="${pp}">1</a></li>-->
            <li th:each="pagenum:${#numbers.sequence(1,pager.totalPage)}">
                    <span th:if="${pagenum} != 0">
                        <a th:href="@{/loan/back-audit/list(currPage=${pagenum})}" th:text="${pagenum}"></a>
                    </span>
            </li>
            <li><a th:href="@{/loan/back-audit/list(currPage=${pager.currPage+1})}">&gt;</a></li>
            <li><a th:href="@{/loan/back-audit/list(currPage=${pager.totalPage})}">&raquo;</a></li>
        </ul>
    </div>
    <div class="modal fade" id="delcfmModel">
        <div class="modal-dialog">
            <div class="modal-content message_align">
                <div class="modal-header">
                    <button aria-label="Close" class="close" data-dismiss="modal" type="button"><span
                            aria-hidden="true">×</span></button>
                    <h4 class="modal-title">确认信息</h4>
                </div>
                <div class="modal-body">
                    <p id="delcfmMsg">您确认要删除吗？</p>
                </div>
                <div class="modal-footer">
                    <input id="submitUrl" type="hidden"/>
                    <input id="subuid" type="hidden"/>
                    <button class="btn btn-default" data-dismiss="modal" type="button">取消</button>
                    <a class="btn btn-success" data-dismiss="modal" onclick="urlSubmit()">确定</a>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <footer class="cm-footer"><span class="pull-left">Connected as John Smith</span><span class="pull-right">&copy; PAOMEDIA SARL</span></footer>
</div>
<script type="text/javascript">
    function auditSubmit(agree, uid) {
        //提交审核结果url
        var submitUrl = agree;
        var submituid = uid;
        $('#submitUrl').val(submitUrl);//给会话中的隐藏属性URL赋值
        $('#subuid').val(submituid);
        $('#delcfmMsg').html("您确认执行此操作吗?");
        $('#delcfmModel').modal();
    }

    function urlSubmit() {
        var submitUrl = $.trim($("#submitUrl").val());//获取会话中的隐藏属性URL
        var subid = $.trim($("#subuid").val());
        var intid = $("#" + subid + "").attr("value");
        $.post('[[@{/loan/back-audit/audupd}]]', {
            audid: intid,
            submitUrl: submitUrl
        }, function (data) {
            window.location.reload();
        }, 'text')

    }
</script>
<!--<script th:replace="common/admin/common::common_footer"></script>-->
<script th:src="@{/admin/assets/js/demo/home.js}"></script>
</body>
</html>
